package com.adityayadav.peekaboo;

import java.net.Socket;
import java.util.HashMap;

public class SocketRegistry {

	private static SocketRegistry instance = null;
	private HashMap<Socket,Processors> registry = new HashMap<Socket,Processors>();
	
	
	private SocketRegistry(){}
	
	public static SocketRegistry getInstance(){
		if (instance == null) {
			instance = new SocketRegistry();
		}
		return instance;
	}
	
	public void close(Socket clientSocket){
		registry.remove(clientSocket);
	}
	
	public void put(Socket clientSocket,Processors processors){
		registry.put(clientSocket, processors);
	}
	
	public Processors get(Socket clientSocket){
		return registry.get(clientSocket);
	}
}
